/**
 * 
 */
package pyrachnid.view.listener;

import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import pyrachnid.ctrl.Simulator;

/**
 * @author zygou
 *
 */
public class SliderSpeedListener implements ChangeListener {

	Simulator _simulator;
	
	public SliderSpeedListener(Simulator sim) {
		this._simulator = sim;
	}

	@Override
	public void stateChanged(ChangeEvent arg0) {
		JSlider slider = (JSlider) arg0.getSource();
		_simulator.getSenario().setSpeed(slider.getValue());
	}

}
